<template>
  <el-card style="width: 100%; height: 550px ">
    <div id="useruse" style="width: 100%;height: 550px"></div>
  </el-card>

</template>

<script>

export default {
  name: "UserUse",
  props:{
    analysisData:{}
  },
  data() {
    return {
    }
  },
  created() {
    this.$nextTick(function (){
      let echartsInstance = this.$echarts.init(document.getElementById("useruse"))
      this.showEcharts(echartsInstance)
    })

  },
  methods:{

    showEcharts(echartsInstance){
      console.log(this.analysisData)
      echartsInstance.setOption({
        tooltip: {
          trigger: 'axis',
          axisPointer: {
            type: 'shadow'
          }
        },
        grid: {
          left: '3%',
          right: '4%',
          bottom: '3%',
          containLabel: true
        },
        xAxis: [
          {
            type: 'category',
            data: this.analysisData.date,
            axisTick: {
              alignWithLabel: true
            }
          }
        ],
        yAxis: [
          {
            type: 'value'
          }
        ],
        series: [
          {
            name: 'Direct',
            type: 'bar',
            barWidth: '60%',
            data: this.analysisData.userNumber
          }
        ]
      })
    }
  }
}
</script>

<style scoped>

</style>
